﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Xiaov.SmartWeb.Infrastructure.ExtMethod;

namespace Xiaov.SmartWeb.Model.Statistical.Select
{
    public class MonthSelect_YBBNB:ISelect
    {
        public string DefaultValue
        {
            get;
            set;
        }

        public List<System.Web.UI.WebControls.ListItem> ListItems
        {
            get;
            set;
        }

        public void DataBind(string dw, string tn, string nf, string yf)
        {
            ListItems = new List<System.Web.UI.WebControls.ListItem>();
            if (nf.ToInt32() <= 2013)
            {                
                for (decimal month = 1; month <= 12; month++)
                {
                    ListItems.Add(new System.Web.UI.WebControls.ListItem(month.ToString(), month.ToString()));
                }
                DefaultValue = DateTime.Now.AddMonths(-1).Month.ToString();
            }
            if(nf.ToInt32()>=2014)
            {                
                ListItems.Add(new System.Web.UI.WebControls.ListItem("12", "12"));
                DefaultValue = "12";
            }
        }
    }
}
